<?php
set_include_path ( get_include_path () . PATH_SEPARATOR . '../' );
include_once 'Include.php';

$email = req ('email');
if($email != ""){
	$userTable = new UserTable();
	$d = $userTable->fetchByEmail($email)->toArray();
	$count = count($d);
	
	if($count){
		$_SESSION['email'] = $email;
		
		// send email
		$href = WWW."web/sign_activate.php?id=".$d[0]['id']."&validate=".$d[0]['validate'];
		$to      = $email;
		$subject = 'aba4hire.com Membership Activation';			
		$headers = 'From: danny@simplebyte.net' . "\r\n" .
			'Reply-To: danny@simplebyte.net' . "\r\n" .
			'X-Mailer: PHP/' . phpversion();
		$message = "<p>Congratulations, you got this email.</p>" . 
				"<p>Activate your account by clicking on the activation link below:</p>".
				"<p><a href='" . $href . "'>Activation link here</a></p>".
				"<p>Thanks again for signing up.</p>" .
				"<p>aba4hire.com team</p>".
				"<hr />".
				"<p>If this entry was sent to you without your consent or you have received this email in error, please ignore this email.</p>" . 
				"<p>We love to hear from you. Send us comments / opinions to support@aba4hire.com</p>";
		
		$send = @mail($to, $subject, $message, $headers);
		header( 'Location: sign_thanks.php' ) ;
	}else{
		echo "You input email is not exist!";	
	}
}
?>
<pre>
Enter your email address and we will send you quick link to reset your
password. You can always change your password in your profile.
</pre>
<form action="" method="post" onsubmit="return checkForm()">
<table border="1">
	<tr>
		<td>Email:</td>
		<td><input type="text" id="email" name="email" /></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>If you don't see our email in your inbox, please check your spam folder</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><input type="submit" value="reset password" /></td>
	</tr>
</table>
</form>
<script type="text/javascript">
function checkForm(){	
	var email = $("#email").val();
	if( email ) $("# && password").addClass("warn");
	if(email){
		return true;	
	}
	return false;
}
</script>